﻿using ITXHWEB.Models;
using ReflectionStudio.Core.Events;
using System;
using System.Data;
using System.Web.Mvc;
using WPFExcelReport;
using WPFExcelReport.Helpers;
using ITXHWEB.Infrastructure;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
namespace ITXHWEB.Controllers
{
    public partial class ABFOLGEController : ITXController
    {

        [ChildActionOnly]
        public ActionResult MRSABF(string returnUrl)
        {
            ModelState.Clear();
            UPViewBag();
            ViewBag.ReturnUrl = returnUrl;
            MABF.REMARK = INFO;
            return PartialView(MABF);
        }
        [HttpPost]
        [AllowAnonymous]
        [ValidateAntiForgeryToken]
        public ActionResult MRSABF(VVTLIEFModel model, string returnUrl)
        {
            StartNewJob();
            try
            {
                //WBW.POSTCHG();
            }
            catch (Exception ex)
            {
                //VKPAUF = ex.Message;
                Tracer.Error(ex.StackTrace, ex);
            }
            return RedirectToAction(MAPP, MAPP);
        }
        public void UPViewBag()
        {
            ViewBag.IsPDCReady = MABF.IsPDCReady;
            ViewBag.IsABPReady = MABF.IsABPReady;
            ViewBag.IsAMReady = MABF.IsAMReady;
            ViewBag.IsSTEPReady = MABF.IsSTEPReady;
            ViewBag.IsStaffReady = MABF.IsStaffReady;
            ViewBag.IsStartReady = MABF.IsStart;
            ViewBag.IsGotABE = MABF.IsGotABE;
            ViewBag.IsEndReady = MABF.IsEndReady;
        }
        public void StartNewJob()
        {
            MABF = new ABFOLGEModel(MABF);
            WRUNID = MABF.WRUNID;
            MABF.NEWUSER = CUSER;
            INFO = "请扫描新生产单:";
        }
    }
}
